from django.contrib.auth import get_user_model
from rest_framework import generics
from rest_framework import mixins
from rest_framework import viewsets
from rest_framework.permissions import IsAdminUser
from rest_framework import serializers
User = get_user_model()

class UserSerializer(serializers.Serializer):
    username = serializers.CharField(max_length=50)


class UserListTest4V1(generics.ListAPIView):
    queryset = User.objects.all()
    serializer_class = UserSerializer

    def get_queryset(self):
        x = self.request.method
        return super().get_queryset()


class UserListTest4V2(viewsets.ReadOnlyModelViewSet):
    queryset = User.objects.all()
    serializer_class = UserSerializer

    def get_queryset(self):
        x = self.action

        return super().get_queryset()

